<div id="content">
    <div class="row s_page_title">
        <div class="row s_page_title">
            <sa-big-breadcrumbs [items]="['运维管理[环卫]','安装管理[环卫]','示例图片管理']" icon="fa fa-newspaper-o" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
        </div>
        <sa-widgets-grid>
            <div class="s_table">
                <div sa-widget [editbutton]="false" color="darken" class="clearfix">
                    <header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
                        <h2>示例图片管理</h2>
                    </header>
                    <div>
                        <div class="widget-body no-padding">
                            <div class="page-header clearfix s_table_opreation">
                                <div class="left page-header-btn" style="width: calc(100% - 230px);">
                                    <div class="top_module">
                                        <span class="module_text">车型</span>
                                        <select class="module_inp" name="carType" id="carType" [(ngModel)]="tableParam.carType">
                                            <option value="">全部</option>
                                            <option value="0211">后挂双桶</option>
                                            <option value="0214">侧挂拉杆</option>
                                            <option value="0213">侧挂链条</option>
                                        </select>
                                    </div>
                                    <button class="btn btn-primary" (click)="tableSearch()">查询</button>
                                    <button class="btn btn-primary" (click)="addCompany('',addCarTypeModal,'1')">添加</button>
                                </div>
                                <!-- <div class="right top-search">
                                    <input type="text" [(ngModel)]="tableParam.searchKey" (change)="tableSearch()" class="search-input" placeholder="公司名称">
                                    <span class="top-search-box">
                                        <button class="top-search-btn" type="button" (click)="tableSearch()"> <i class="fa fa-search"></i></button>
                                    </span>
                                </div> -->
                            </div>
                            <div class="table_scroll">
                                <table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                                    <thead>
                                        <tr>
                                            <th>车型</th>
                                            <th>照片总数</th>
                                            <th>最近一次修改时间</th>
                                            <th>修改人员</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr *ngFor="let row of tableData">
                                            <td>{{row.useTypeName}}</td>
                                            <td>{{row.figureCount}}</td>
                                            <td>{{row.updateTime}}</td>
                                            <td>{{row.userName}}</td>
                                            <td>
                                                <button type="button" (click)="addCompany(row,addCarTypeModal,'2')">编辑</button>
                                                <button type="button" (click)="deleteRow(row)">删除</button>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="table-fix clearfix">
                                <paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
                                </paginator>
                                <button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </sa-widgets-grid>
        <!-- 单项编辑   弹窗-->
        <section bsModal #addCarTypeModal="bs-modal" class="modal fade" role="dialog" tabindex="-1" aria-labelledby="myLargeModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
            <div class="modal-dialog modal-lg" style="width:1000px;">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" (click)="itemModalClose(addCarTypeModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">{{formType}}-{{carTypeName}}</h4>
                    </div>
                    <div class="modal-body">
                        <div class="row form-horizontal imageShowList" >
                            <div class="form-group carList" *ngFor="let item of carDataListShow;let itemIndex = index">
                                <div class="col-md-12 carTitle">
                                    {{item.name}}
                                </div>
                                <div class="col-md-12 carDoubleList" *ngFor="let list of item.figureSubsetEntities;let listIndex = index;">
                                    <label class="col-md-12 carDoubleTitle" *ngIf="list.isShow == 0">{{list.name}}</label>
                                    <div class="figureImage" *ngFor="let value of list.figureImageEntities;let valueIndex = index;">
                                        <div *ngIf="value.figureImageList" class="col-md-6 figureImageList" >
                                            <p style="text-align: center;height: 35px;line-height: 35px;">{{value.name}}</p>
                                            <div class="col-md-6" *ngFor="let valueImg of value.figureImageList;let valueImgIndex = index;">
                                                <div class="carDetailList">
                                                    <label class="carDetailTit" [ngClass]="{carDetailTit8: valueImg.name.length<8}">{{valueImg.name}}:</label>
                                                    <div class="carDetailCont">
                                                        <img class="lookImg" [src]="valueImg.imageUrl" *ngIf="valueImg.imageUrl" (click)="bigImgClick()" [alt]="valueImg.name"/>
                                                        <label class="carDetailUpload">
                                                            <input type="file" class="uploadImg" accept="image/*" (change)="fileChange($event.target.files,itemIndex,listIndex,valueIndex,valueImgIndex)"/>
                                                            <span *ngIf="!valueImg.imageUrl">上&nbsp;&nbsp;传</span>
                                                            <span *ngIf="valueImg.imageUrl">修&nbsp;&nbsp;改</span>
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div *ngIf="!value.figureImageList" class="col-md-3">
                                            <div class="carDetailList">
                                                <label class="carDetailTit" [ngClass]="{carDetailTit8: value.name.length<8}">{{value.name}}:</label>
                                                <div class="carDetailCont">
                                                    <img class="lookImg" [src]="value.imageUrl" *ngIf="value.imageUrl" (click)="bigImgClick()" [alt]="value.name"/>
                                                    <label class="carDetailUpload">
                                                        <input type="file" class="uploadImg" accept="image/*" (change)="fileChange($event.target.files,itemIndex,listIndex,valueIndex,'')"/>
                                                        <span *ngIf="!value.imageUrl">上&nbsp;&nbsp;传</span>
                                                        <span *ngIf="value.imageUrl">修&nbsp;&nbsp;改</span>
                                                    </label>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" (click)="itemModalClose(addCarTypeModal)">取消</button>
                        <button type="button" class="btn btn-primary" (click)="itemModalSubmit(addCarTypeModal)">确认</button>
                    </div>
                </div>
            </div>
        </section>
        <!-- 单项编辑 弹窗end-->
    </div>